home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************\
-
- File: SlideWipe.c
-
- Purpose: This module handles clearing the screen in a funky
- manner. See the comments below for more details.
-
-
- Shutdown FX -=- graphic effects on shutdown
- Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program in a file named "GNU General Public License".
- If not, write to the Free Software Foundation, 675 Mass Ave,
- Cambridge, MA 02139, USA.
-
- \**********************************************************************/
-
- #include "msg timing.h"
-
- #define BoxSize 20
- #define StripSize 40
- #define CorrectTime 1
-
- void SlideWipe(GrafPtr thePtr, Pattern *thePattern, int width, int height);
-
- /* cut the screen into strips of size StripSize and scroll each strip either
- left or right, successively. */
-
- void SlideWipe(GrafPtr thePtr, Pattern *thePattern, int width, int height)
- {
- int x, y;
- Rect dest;
- Rect scrollsource, scrolldest;
- int direction;
-
- direction = 0;
-
- for(y = 0; y < height; y += StripSize)
- {
- SetRect(&scrollsource, 0, y, width, y+StripSize);
- scrolldest = scrollsource;
- SetRect(&dest, 0, y, width, y+StripSize);
-
- if(direction == 0)
- {
- OffsetRect(&scrolldest, BoxSize, 0);
- dest.right = dest.left + BoxSize;
- for(x = width - BoxSize; x >= 0; x -= BoxSize)
- {
- StartTiming();
- CopyBits(&(thePtr->portBits), &(thePtr->portBits),
- &scrollsource, &scrolldest, 0, 0L);
- FillRect(&dest, *thePattern);
- TimeCorrection(CorrectTime);
- }
- }
- else
- {
- OffsetRect(&scrolldest, -BoxSize, 0);
- dest.left = dest.right - BoxSize;
- for(x = BoxSize; x <= width; x += BoxSize)
- {
- StartTiming();
- CopyBits(&(thePtr->portBits), &(thePtr->portBits),
- &scrollsource, &scrolldest, 0, 0L);
- FillRect(&dest, *thePattern);
- TimeCorrection(CorrectTime);
- }
- }
-
- direction = 1 - direction;
- }
- }
-